<template>
	<div class="pageContacts overHid">
		<div class="goBackButtonBox">
			<div @click="handleClosed" class="item cursor-pointer el-icon-arrow-left font24"></div>
		</div>

		<div class="pageMainBox">
			<el-button class="itemSelect" type="primary" @click.native.prevent="handleSelect">
				查询日志</el-button>
			<div class="textCenter" v-if="isshowdatalist">
				{{datalist}}
			</div>
			<div v-else class="color-smill textCenter">
				{{resmessage ||"暂无数据"}}
			</div>
		</div>

	</div>

</template>

<script>
	import {
		banned,
		getUserInfoAll
	} from '@/api/user'
	import {
		debounce
	} from "@/utils/common.js";
	export default {
		name: "banned",
		data() {
			const validate = (rule, value, callback) => {
				if (!value) {
					callback(new Error("被封禁者id必填"));
				} else {
					callback();
				}
			};
			return {
				ListLoading: false,
				loading: false, //操作loading
				Vloading: false,
				msgConfig: {
					minScrollBottom: 100, //距离msg底部height 小于？就查询
					isExecuteShowMore: false, //距离msg？部height
					msglistResults: false, //msg查询结果 false 终止查询
				},
				pageConfig: {
					pageSizes: 10, //条数
					pageNum: 1, //页数 第n页
				},
				resmessage: "",
				datalist: {},
				isshowdatalist: false,
			}
		},
		computed: {
			storeUserinfo() {
				return this.$store.getters.userInfo;
			},
		},
		mounted() {
			if (!this.storeUserinfo.Id) {
				this.$router.push('home')
				return
			}
		},
		methods: {
			handleSelect: debounce(function() {
				try {
					getLogs().then(data => {
						if (!data.data) {
							this.resmessage = data.message
							this.datalist = []
							this.isshowdatalist = false
							return;
						}
						this.isshowdatalist = true;
						this.resmessage = ""
						this.datalist = Object.assign({}, res.data)


					})
				} catch (error) {
					this.$message({
						message: error,
						type: 'error'
					});
				}
			}),
			handleClosed() {
				// this.$router.go(-1)
				this.$router.push({
					name: "home",
					params: {

					}
				})
			},


		},
		watch: {

		}
	}
</script>

<style scoped>
	.pageContacts {
		width: 100%;
		padding: 0 10px;
		box-sizing: border-box;
	}


	.items {
		display: flex;
		justify-content: space-between;
		margin: 12px 0;
		align-items: center;
		border-radius: 8px;
		padding-bottom: 5px;
		border-bottom: 1px dashed #A0E9FF;
	}

	.items:hover {
		background-color: #A0E9FF;
	}



	/* 返回的按钮 */
	.goBackButtonBox {
		font-size: 24px;
		font-weight: 500;
		display: inline-block;
		position: fixed;
		left: 0;
		top: 0;
		margin: 0;
		padding: 0 20px;
		z-index: 22;
		width: 100%;
		height: 40px;
		line-height: 40px;
		text-align: left;
		background-color: #fff;
	}

	.goBackButtonBox .item {
		width: 50px;
	}

	.pageMainBox {
		margin-top: 45px;
		height: calc(100vh - 80px);
		padding-top: 20px;
		box-sizing: border-box;
		background-color: #fff;
	}

	.itemSelect,
	.itemBtn {
		width: 45%;
		margin-top: 20px;
		border-radius: 18px;
		background-image: linear-gradient(to top, #007adf 0%, #00ecbc 100%);
	}
</style>